package com.atguigu.sync;

public class Ticket {
    private int number = 100;

    public synchronized void sale(){
        if (number > 0){
            number--;
            System.out.println(Thread.currentThread().getName()+"剩余："+number);
        }
    }
}
